#include <iostream>
#include <vector>
#include <Vector.hpp>
using namespace std;

class Solution
{
public:
    vector<int> twoSum(vector<int> &numbers, int target)
    {
        int startIndex = 0;
        int endIndex = numbers.size() - 1;
        while (numbers[startIndex] + numbers[endIndex] != target)
        {
            if (numbers[startIndex] + numbers[endIndex] > target)
            {
                endIndex--;
            }
            else if (numbers[startIndex] + numbers[endIndex] < target)
            {
                startIndex++;
            }
        }
        return {startIndex + 1, endIndex + 1};
    }
};
int main()
{
    cout << "Code167" << endl;
    Solution s;
    vector<int> numbers = {2, 7, 11, 15};
    int target = 9;
    vector<int> result = s.twoSum(numbers, target);
    PrintVector(result);
    return 0;
}